<template lang="html">
    <div>
      <h4>{{movieTheatre.name}}({{movieTheatre.brandName}})</h4>


        <div v-for="cinemasDetailShow in cinemasDetailShowVos">

            <img :src="cinemasDetailShow.cinemasMovieVo.previewUrl" style="width: 100px;height: 100px" />
            <h4>{{cinemasDetailShow.cinemasMovieVo.name}}</h4>

            <table>

                <tr style="font-size: 5px">
                    <td>开始日期</td>
                    <td>结束日期</td>
                    <td>语言</td>
                    <td>放映厅</td>
                    <td>价格</td>
                    <td>操作</td>
                </tr>

                <tr v-for="(item,key,index) in cinemasDetailShow.movieTheatreShows" >
                    <span>{{dataTime(cinemasDetailShow.dateShow,index)}}</span>
                    <div v-for="movie in item" style="font-size: 5px">
                        <td>{{movie.startDate.toString().substring(0,16)}}</td>
                        <td>{{movie.endDate.toString().substring(0,16)}}</td>
                        <td style="width: 50px">{{movie.languageVersion}}</td>
                        <td style="width: 50px;height: 50px">{{movie.videoHall}}</td>
                        <td>{{movie.price}}</td>
                        <td><button style="color: red" @click="selectionSeat(movie.movieId,movie.id)">点击</button></td>
                    </div>
                </tr>
            </table>


        </div>


    </div>
</template>
<script>
    import cineamsApi from "../../api/cineams";

    export default {
        created() {
            this.movieTheatreId = this.$route.params.movieTheatreId
            cineamsApi.cinemaDetail(this.movieTheatreId).then(response=>{
                console.log(response);
                this.movieTheatre=response.movieTheatre
                this.movieTheatreServerVoList= response.movieTheatreServerVoList
                this.cinemasDetailShowVos = response.cinemasDetailShowVos
            }).catch(error=>{
                console.log(error)

            })
        },

        data() {
            return {
                movieTheatreId:null,
                movieTheatre:null,
                movieTheatreServerVoList:null,
                cinemasDetailShowVos:null

            }
        },
        methods: {
            selectionSeat(movieId,movieShowId){
                this.$router.push(`/selectionSeat/${movieId}/${movieShowId}`)

            },
            dataTime(dateShow,key){
                return dateShow[key]
            }

        }
    }
</script>

<style lang="scss">

</style>
